<template>
  <div class="page">
    <base-header :title="`${title}项目情况`"></base-header>

    <div class="p-20">
      <base-title>2023年6月</base-title>

      <!-- 表格 -->
      <div v-for="(t, tIndex) in tableJsons" :key="tIndex">
        <base-title :inline="true" v-if="t.title">{{ t.title }}</base-title>
        <base-table
          class="mb-20"
          :columns="t.columns"
          :datas="t.datas"
        ></base-table>
      </div>

      <div class="mb-20">
        <u-button type="primary" @click="toArticlePage">
          ABB机器人超级工厂项目
        </u-button>
      </div>

      <div>
        <u-button type="primary">上海XX电子厂项目</u-button>
      </div>
    </div>

    <div class="footer bd-top"></div>
  </div>
</template>

<script>
import tableJsons from "./tableJsons";

export default {
  data() {
    return {
      tableJsons: [],
    };
  },

  onLoad(options = {}) {
    this.title = options.title;

    const datas = tableJsons[0].datas.filter((d) => d.a === this.title);
    this.tableJsons = [
      {
        ...tableJsons[0],
        datas,
      },
    ];
  },

  methods: {
    toArticlePage() {
      uni.navigateTo({
        url: "/pages/news/article",
      });
    },
  },
};
</script>

<style lang="scss" scoped></style>
